<form class="form-inline" method="get">

    <div class="form-group col-xs-4"  style="width: 20%;">
        <div class="col-xs-12">
            <input class="form-control" name="condition" value="{$condition}"
                   placeholder="发送方商会名称|发送方商会ID">
        </div>
    </div>
    <div class="form-group col-xs-4"  style="width: 20%;">
        <div class="col-xs-12">
            <input class="form-control" name="condition2" value="{$condition2}"
                   placeholder="接收方商会名称|接收方商会ID">
        </div>
    </div>

    <div class="form-group col-xs-2">
        <div class="col-xs-12">
            <select id="status-selector" name="status" class="form-control" tabindex="-1">
                <option value="">无选择</option>
                <?php foreach($status_list as $itk=>$item){ ?>
                <option value="{$itk}" {if condition="$status!=''&&$status==$itk"}selected{/if}>{$item}</option>
                <?php } ?>
            </select>
        </div>
    </div>

    <div class="form-group col-xs-4" style="width: 20%;">
        <button type="submit" class="btn btn-success">
            搜索
        </button>

    </div>
</form>

<hr>

<table class="table table-striped">
    <thead>
    <tr>
        <td>ID</td>
        <td>发送方商会</td>
        <td>接收方商会</td>
        <td>状态</td>
        <td>发送时间</td>
        <td>处理时间</td>
        <td>操作</td>
    </tr>
    </thead>
    <tbody>
    {volist name="list" id="item"}
    <tr>
        <td>{$item.id}</td>
        <td>{$item.sender_name}【ID：{$item.sender_bus_id}】</td>
        <td>{$item.receiver_name}【ID：{$item.receiver_bus_id}】</td>
        <td>
            {if condition="$item.status==0"}
            <label class="label label-danger">{$item.status|get_bussiness_agreement_status}</label>
            {else/}
            <label class="label label-success">{$item.status|get_bussiness_agreement_status}</label>
            {/if}
        </td>
        <td>{$item.create_time|show_datetime}</td>
        <td>{$item.update_time|show_datetime}</td>
        <td>

            <div class="btn-group">
                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    操作
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    {if condition="$item.status==0"}
                    <li>
                        <a href="javascript:void(0)" data-toggle="confirm"
                           data-title="同意合约"
                           data-content="确认同意？同意后双方商会将信息互通！"
                           data-url="{:url('status',array('id'=>$item['id']))}">
                            同意合约
                        </a>
                    </li>
                    {else/}
                    <li>
                        <a href="javascript:void(0)" data-toggle="confirm"
                           data-title="取消同意"
                           data-content="确认取消？取消后双方商会将无法信息互通！"
                           data-url="{:url('status',array('id'=>$item['id']))}">
                            取消同意
                        </a>
                    </li>
                    {/if}
                    <li>
                        <a href="javascript:void(0)" data-toggle="confirm"
                           data-title="删除信息互通合约"
                           data-content="确认删除？删除后双方商会将无法信息互通，请谨慎操作！"
                           data-url="{:url('remove',array('id'=>$item['id']))}">
                            删除
                        </a>
                    </li>


                    <li role="separator" class="divider"></li>
                </ul>
            </div>
        </td>
    </tr>
    {/volist}
    </tbody>
</table>

<div class="row">
    <div class="col-xs-12" style="text-align: right;">
        {$list->render()}
    </div>
</div>

<script src="__PUBLIC__/vendors/select2/js/select2.min.js"></script>
<script type="application/javascript">
    $(function () {

        //获取分类
        $("#status-selector").select2({
            placeholder: "选择处理状态",
            allowClear: true
        });
    });
</script>